package SEDay05;

import java.util.Random;

    /**
     * 需求：定义一个长度为5的一维数组，给每个元素赋值. (要求数组中每个元素的值是20-80的随机数)
    遍历数组打印每个元素的值*/

public class Subject1 {
    public static void main(String[] args) {
        int[] arr = new int[5];
        Random random = new Random();
        for (int i = 0; i < 5; i++) {
            arr[i] = random.nextInt(61) + 20;
            System.out.println("随机数为："+arr[i]);
        }
    }
}
